home *** CD-ROM | disk | FTP | other *** search
/ PC Open 93 / PC Open 93 CD 1.bin / grafica / PicSizer v2.0 / Setup.exe / Main / PicSizer.exe / PicSizer.dxr / 00082_source destination fields.ls < prev    next >
Encoding:
Text File  |  2003-12-08  |  2.8 KB  |  92 lines

  1. property pMySprite
  2. global gFormatList
  3.  
  4. on beginSprite me
  5.   pMySprite = sprite(me.spriteNum)
  6. end
  7.  
  8. on mouseEnter me
  9.   case the currentSpriteNum of
  10.     "80":
  11.       put "Source path. Click to browse for a new folder or file to process. D + click to clear." into field "status"
  12.     "82":
  13.       put "Destination folder path. Click to browse for new folder. D + click to clear." into field "status"
  14.   end case
  15. end
  16.  
  17. on mouseLeave me
  18.   put EMPTY into field "status"
  19. end
  20.  
  21. on mouseDown me
  22.   if keyPressed("d") then
  23.     pMySprite.member.text = EMPTY
  24.     pass()
  25.   else
  26.     if pMySprite = sprite(82) then
  27.       if sprite(86).pState then
  28.         folderText()
  29.       else
  30.         myFolder = baGetFolder(pMySprite.member.text, "Select a folder for the resized images:", 1, "Browse for Folder", -1, 0)
  31.         if myFolder = EMPTY then
  32.           pass()
  33.         else
  34.           pMySprite.member.text = myFolder
  35.         end if
  36.       end if
  37.     else
  38.       thePath = pMySprite.member.text
  39.       if the last char in thePath = "\" then
  40.         nothing()
  41.       else
  42.         the itemDelimiter = "\"
  43.         delete char -30002 of thePath
  44.         put "\" after myFolder
  45.         the itemDelimiter = ","
  46.       end if
  47.       if sprite(84).pState then
  48.         sourceFile = baGetFilename("open", thePath, EMPTY, "Image files (.jpg, .gif, .bmp, .png, .tif, .tga)|*.jpg;*.gif;*.bmp;*.png;*.tif;*.tga", 2 + 4 + 524288, "Select Image to Process", 0, -1, 0)
  49.         if sourceFile = EMPTY then
  50.           pass()
  51.         else
  52.           sFileCount = the number of chars in sourceFile
  53.           sFileEx = char sFileCount - 2 to sFileCount of sourceFile
  54.           if getOne(gFormatList, symbol(sFileEx)) = 0 then
  55.             if sFileEx = "jpg" then
  56.               sendSprite(24, #finishSetting2)
  57.             else
  58.               if sFileEx = "gif" then
  59.                 sendSprite(26, #finishSetting2)
  60.               else
  61.                 if sFileEx = "bmp" then
  62.                   sendSprite(28, #finishSetting2)
  63.                 else
  64.                   if sFileEx = "png" then
  65.                     sendSprite(30, #finishSetting2)
  66.                   else
  67.                     if sFileEx = "tif" then
  68.                       sendSprite(32, #finishSetting2)
  69.                     else
  70.                       if sFileEx = "tga" then
  71.                         sendSprite(34, #finishSetting2)
  72.                       end if
  73.                     end if
  74.                   end if
  75.                 end if
  76.               end if
  77.             end if
  78.           end if
  79.           pMySprite.member.text = sourceFile
  80.         end if
  81.       else
  82.         myFolder = baGetFolder(thePath, "Select the folder containing the original images:", 1, "Browse for Folder", -1, 0)
  83.         if myFolder = EMPTY then
  84.           pass()
  85.         else
  86.           pMySprite.member.text = myFolder
  87.         end if
  88.       end if
  89.     end if
  90.   end if
  91. end
  92.